home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / B::Deparse.Z / B::Deparse
Encoding:
Text File  |  1998-10-28  |  5.3 KB  |  199 lines

  1.  
  2.  
  3.  
  4.      BBBB::::::::DDDDeeeeppppaaaarrrrsssseeee((((3333))))   22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))     BBBB::::::::DDDDeeeeppppaaaarrrrsssseeee((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       B::Deparse - Perl compiler backend to    produce    perl code
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.       ppppeeeerrrrllll ----MMMMOOOO====DDDDeeeeppppaaaarrrrsssseeee[,,,,----uuuu_P_A_C_K_A_G_E][,,,,----pppp][,,,,----llll][,,,,----ssss_L_E_T_T_E_R_S] _p_r_o_g._p_l
  13.  
  14.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.       B::Deparse is    a backend module for the Perl compiler that
  16.       generates perl source    code, based on the internal compiled
  17.       structure that perl itself creates after parsing a program.
  18.       The output of    B::Deparse won't be exactly the    same as    the
  19.       original source, since perl doesn't keep track of comments
  20.       or whitespace, and there isn't a one-to-one correspondence
  21.       between perl's syntactical constructions and their compiled
  22.       form,    but it will often be close. When you use the ----pppp
  23.       option, the output also includes parentheses even when they
  24.       are not required by precedence, which    can make it easy to
  25.       see if perl is parsing your expressions the way you
  26.       intended.
  27.  
  28.       Please note that this    module is mainly new and untested code
  29.       and is still under development, so it    may change in the
  30.       future.
  31.  
  32.      OOOOPPPPTTTTIIIIOOOONNNNSSSS
  33.       As with all compiler backend options,    these must follow
  34.       directly after the '-MO=Deparse', separated by a comma but
  35.       not any white    space.
  36.  
  37.       ----pppp  Print extra parentheses. Without this option, B::Deparse
  38.           includes parentheses in its output only when they    are
  39.           needed, based on the structure of    your program. With ----pppp,
  40.           it uses parentheses (almost) whenever they would be
  41.           legal. This can be useful    if you are used    to LISP, or if
  42.           you want to see how perl parses your input. If you say
  43.  
  44.           if ($var & 0x7f == 65) {print    "Gimme an A!"}
  45.           print    ($which    ? $a : $b), "\n";
  46.           $name    = $ENV{USER} or    "Bob";
  47.  
  48.           B::Deparse,-p will print
  49.  
  50.           if (($var & 0)) {
  51.               print('Gimme an A!')
  52.           };
  53.           (print(($which ? $a :    $b)), '???');
  54.           (($name = $ENV{'USER'}) or '???')
  55.  
  56.           which probably isn't what    you intended (the '???'    is a
  57.           sign that    perl optimized away a constant value).
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      BBBB::::::::DDDDeeeeppppaaaarrrrsssseeee((((3333))))   22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))     BBBB::::::::DDDDeeeeppppaaaarrrrsssseeee((((3333))))
  71.  
  72.  
  73.  
  74.       ----uuuu_P_A_C_K_A_G_E
  75.           Normally,    B::Deparse deparses the    main code of a
  76.           program, all the subs called by the main program (and
  77.           all the subs called by them, recursively), and any other
  78.           subs in the main:: package. To include subs in other
  79.           packages that aren't called directly, such as AUTOLOAD,
  80.           DESTROY, other subs called automatically by perl,    and
  81.           methods, which aren't resolved to    subs until runtime,
  82.           use the ----uuuu option. The argument to ----uuuu is the name    of a
  83.           package, and should follow directly after    the 'u'.
  84.           Multiple ----uuuu options may be given,    separated by commas.
  85.           Note that    unlike some other backends, B::Deparse doesn't
  86.           (yet) try    to guess automatically when ----uuuu is needed --
  87.           you must invoke it yourself.
  88.  
  89.       ----llll  Add '#line' declarations to the output based on the line
  90.           and file locations of the    original code.
  91.  
  92.       ----ssss_L_E_T_T_E_R_S
  93.           Tweak the    style of B::Deparse's output. At the moment,
  94.           only one style option is implemented:
  95.  
  96.       CCCC      Cuddle elsif,    else, and continue blocks. For
  97.           example, print
  98.  
  99.               if (...) {
  100.                ...
  101.               }    else {
  102.                ...
  103.               }
  104.  
  105.           instead of
  106.  
  107.               if (...) {
  108.                ...
  109.               }
  110.               else {
  111.                ...
  112.               }
  113.  
  114.           The default is not to    cuddle.
  115.  
  116.      BBBBUUUUGGGGSSSS
  117.       See the 'to do' list at the beginning    of the module file.
  118.  
  119.      AAAAUUUUTTTTHHHHOOOORRRR
  120.       Stephen McCamant <alias@mcs.com>, based on an    earlier
  121.       version by Malcolm Beattie <mbeattie@sable.ox.ac.uk>.
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                        (printed 10/23/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      BBBB::::::::DDDDeeeeppppaaaarrrrsssseeee((((3333))))   22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))     BBBB::::::::DDDDeeeeppppaaaarrrrsssseeee((((3333))))
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.      Page 3                        (printed 10/23/98)
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.